#define _CRT_SECURE_NO_WARNINGS 1
#include"SList.h"

void SLtest1()
{
	SLNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);
	SListPushBack(&plist, 5);
	SListPushFront(&plist, 0);
	SListPushBack(&plist, 6);
	SListPushBack(&plist, 7);
	SListPushFront(&plist, -1);
	SListPrint(plist);


}

void SLtest2()
{
	SLNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);
	SListPrint(plist);
	SListPopBack(&plist);
	SListPrint(plist);
	SListPopFront(&plist);
	SListPrint(plist);
}
void SLtest3()
{
	SLNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);
	SListPushBack(&plist, 8);
	SListPushBack(&plist, 9);
	SListPushBack(&plist, 10);
	SListPushBack(&plist, 5);
	SListPushBack(&plist, 6);
	SListPushBack(&plist, 7);
	SListInsertAfter(SListFind(plist, 5), 12);
	SListInsertAfter(SListFind(plist, 12), 13);
	SListInsertAfter(SListFind(plist, 7), 12);
	SListEraseAfter(SListFind(plist, 5));
	SListPrint(plist);
	SLTInsert(&plist, SListFind(plist, 8), 80);
	SListPrint(plist);
	
}

void SLtest4()
{
	SLNode* plist = NULL;
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 4);
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 5);
	SListPushBack(&plist, 9);
	SListPushBack(&plist, 8);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 6);
	SListPrint(plist);
	SLTErase(&plist, SListFind(plist, 8));
	SLTDestroy(&plist);
	SListPrint(plist);
	
}

int main()
{
	//SLtest1();
	//SLtest2();
	//SLtest3();
	SLtest4();


	return 0;
}